/**
 * 
 */
package com.thinkgsp.jxc.model;

import java.io.Serializable;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 部门类
 * @author evan
 *
 */
public class Dept extends BaseModel implements Serializable {

	private static final long serialVersionUID = 6643280963743028416L;

	private Integer deptId;
	private String deptName;
	private String description;
	private boolean defaultDept;
	
	/**
	 * 部门ID
	 * @return
	 */
	public Integer getDeptId() {
		return deptId;
	}

	public void setDeptId(Integer deptId) {
		this.deptId = deptId;
	}

	/**
	 * 部门名称
	 * @return
	 */
	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	/**
	 * 描述
	 * @return
	 */
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * 默认的用户登录部门，本属性只在用户的可登陆部门列表中使用
	 * @return the defaultDept
	 */
	public boolean isDefaultDept() {
		return defaultDept;
	}

	/**
	 * @param defaultDept the defaultDept to set
	 */
	public void setDefaultDept(boolean defaultDept) {
		this.defaultDept = defaultDept;
	}

	/* (non-Javadoc)
	 * @see com.thinkgsp.jxc.model.BaseModel#toString()
	 */
	@Override
	public String toString() {
		ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
		sb.append("deptId",this.deptId)
		  .append("deptName",this.deptName)
		  .append("description",this.description);
		
		return sb.toString();
	}

	/* (non-Javadoc)
	 * @see com.thinkgsp.jxc.model.BaseModel#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object o) {
		if(this == o) {
			return true;
		}
		if(!(o instanceof Dept)) {
			return false;
		}
		final Dept dept = (Dept)o;
		if(deptId != null) {
			return deptId.equals(dept.getDeptId());
		} else {
			return dept.getDeptId() == null;
		}
	}

	/* (non-Javadoc)
	 * @see com.thinkgsp.jxc.model.BaseModel#hashCode()
	 */
	@Override
	public int hashCode() {
		return (this.deptId != null ? this.deptId.hashCode() : 0);
	}

}
